//
//  CXConfigMacro.h
//  喜马拉雅FM
//
//  Created by hcios on 2017/8/27.
//  Copyright © 2017年 hcios. All rights reserved.
//

#ifndef JFConfigMacro_h
#define JFConfigMacro_h

// 屏幕宽、高
#define DEVICE_SCREEN_FRAME     ([UIScreen mainScreen].bounds)
#define DEVICE_SCREEN_WIDTH     ([UIScreen mainScreen].bounds.size.width)
#define DEVICE_SCREEN_HEIGHT    ([UIScreen mainScreen].bounds.size.height)
// 导航栏宽、高
#define NAVIGATIONBAR_WIDTH     DEVICE_SCREEN_WIDTH
#define NAVIGATIONBAR_HEIGHT    64.f
// 标签栏宽、高
#define TABBAR_WIDTH            DEVICE_SCREEN_WIDTH
#define TABBAR_HEIGHT           49.f
// 状态栏高度
#define STATUSBAR_HEIGHT        20.f

// 判断设备型号
#define UI_IS_LANDSCAPE         ([UIDevice currentDevice].orientation == UIDeviceOrientationLandscapeLeft || [UIDevice currentDevice].orientation == UIDeviceOrientationLandscapeRight)
#define UI_IS_IPAD              ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
#define UI_IS_IPHONE            ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)
#define UI_IS_IPHONE4           (UI_IS_IPHONE && DEVICE_SCREEN_HEIGHT < 568.0)
#define UI_IS_IPHONE5           (UI_IS_IPHONE && DEVICE_SCREEN_HEIGHT == 568.0)
#define UI_IS_IPHONE6           (UI_IS_IPHONE && DEVICE_SCREEN_HEIGHT == 667.0)
#define UI_IS_IPHONE6PLUS       (UI_IS_IPHONE && DEVICE_SCREEN_HEIGHT == 736.0 || DEVICE_SCREEN_WIDTH == 736.0) // Both orientations
#define UI_IS_IOS8_AND_HIGHER   ([[UIDevice currentDevice].systemVersion floatValue] >= 8.0)


//RGB 颜色
#define KRGBA(r,g,b,a)  [UIColor colorWithRed:(r) / 255.0f green:(g) / 255.0f blue:(b) / 255.0f alpha:a]

#define RGB(r,g,b)      KRGBA(r,g,b,1.0f)

// 由角度获取弧度、有弧度获取角度
#define kDegreesToRadian(x)         (M_PI * (x) / 180.0)
#define kRadianToDegrees(radian)    (((radian) * 180.0) / (M_PI))

#define WS(weakSelf)    __weak __typeof(&*self)weakSelf = self

// 获取图片
#define kGetImage(name)     [UIImage imageNamed:name]

#define FONTNAME_PF        @"PingFangSC-Regular"
#define FONTNAMEBLOD_PF    @"PingFangSC-Medium"
#define FONTNAME_FZLTH     @"FZLanTingHeiS-R-GB"

#ifdef DEBUG
#define JFLog(xx, ...)          NSLog((@"%s [Line %d] " xx), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
#else
#define JFLog(...)
#endif

#ifdef __cplusplus
#define JFKIT_EXTERN		extern "C" __attribute__((visibility ("default")))
#else
#define JFKIT_EXTERN	        extern __attribute__((visibility ("default")))
#endif

#endif /* CXConfigMacro_h */
